<?php

namespace app\index\controller;

use think\Db;
use think\facade\Config;
use think\Controller;
use think\Request;
use think\captcha\Captcha;
use think\facade\Session;
use think\View;

class CaseStudies extends Base
{
    public function index()
    {
        $data['base_data']=$this->base_data;
        $class_id = request()->param()['class_id'];
        $data['crumbs']=get_crumbs($class_id);/*面包屑*/
        /*设置seo*/
        $default_lang=config('app.default_lang');
        $data['seo_desc']="";
        if($default_lang=='en-us'){
            $data['seo_title']="Lily Bearing Case | Lily Bearing";
            $data['seo_keywords']="Lily Bearing Case | Lily Bearing";
        }
        if($default_lang=='zh-cn'){
            $data['seo_title']="养贞轴承案例 | 养贞轴承";
            $data['seo_keywords']="养贞轴承案例 | 养贞轴承";
        }
        $this->assign($data);
        return $this->fetch('index');
    }

    public function detail() {
        $case_number = \request()->param()['case_number'];
        if (!$case_number) {
            header("Status: 404");
            return $this->fetch('404/404');
        }
        $data['base_data']=$this->base_data;
        $class_id = 2152;
        $data['crumbs']=get_crumbs($class_id);/*面包屑*/
        $default_lang=config('app.default_lang');
        $data['seo_desc']="";
        if($default_lang=='en-us'){
            $data['seo_title']="Lily Bearing Case | Lily Bearing";
            $data['seo_keywords']="Lily Bearing Case | Lily Bearing";
        }
        if($default_lang=='zh-cn'){
            $data['seo_title']="养贞轴承案例 | 养贞轴承";
            $data['seo_keywords']="养贞轴承案例 | 养贞轴承";
        }
        $this->assign($data);
        if ($case_number == 1) {
            return $this->fetch('detail_1');
        }
    }
}